export default {
	login(val) {
		let { username, pwd } = JSON.parse(val.body);
		let token = "";
		let data = {
			code: 200,
			msg: "登录成功",
			success: 0,
			data: { token },
		};
		if (username === "admin" && pwd === "123456") {
			data.data.token = "admin---";
		} else if (username === "user" && pwd === "123456") {
			data.data.token = "user---";
		} else {
			data.code = 101;
			data.msg = "账号或密码错误";
			data.success = 1;
			data.data.token = null;
		}
		return data;
	},
};
